import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JPanel;


/*
 * MapPanel.java
 *
 * Version 1.0
 * Copyright 2011 BobSoft Inc
 */

/**
 * @author Robert
 * @version 1.0
 *
 */
public class TrailImagePanel extends JPanel {
    /**
	 * 
	 */
	private static final long serialVersionUID = -1891857115652103126L;
	private Image backgroundImage;
    
    public TrailImagePanel(String imageName) {
        this(new ImageIcon(imageName).getImage());
    }

    /**
     * Makes a new MapPanel
     * @param image
     */
    public TrailImagePanel(Image image) {
        backgroundImage = image;
        Dimension size = new Dimension(backgroundImage.getWidth(null), backgroundImage.getHeight(null));
        setPreferredSize(size);
        setMinimumSize(size);
        setMaximumSize(size);
        setSize(size);
        setLayout(null);
    }
    
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(backgroundImage, 0, 0, null);
    }


}

